using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class UI_WepaonSelectSlot : UI_ItemSelectBase
{
    [SerializeField] private TextMeshProUGUI _weaponNameTMP;
    [SerializeField] private TextMeshProUGUI _weaponTypeTMP;
    [SerializeField] private TextMeshProUGUI _weaponDescriptionTMP;
    [SerializeField] private TextMeshProUGUI _weaponStatDescriptionTMP;
    [SerializeField] private Image _weapnIcon;

    public WeaponScrollDataSO CurrentWeaponItemDataSO { get; private set; }
    
    public void SetupWeaponSelectSlot(WeaponScrollDataSO weaponItemDataSO)
    {
        CurrentWeaponItemDataSO = weaponItemDataSO;
        _borderImage.enabled = false;
        _isSelect = false;

        UpdateWeaponSelectSlot();
    }
    public void UpdateWeaponSelectSlot()
    {
        _weaponNameTMP.text = CurrentWeaponItemDataSO.weaponName;
        _weaponTypeTMP.text = CurrentWeaponItemDataSO.weaponType.ToString();
        _weaponStatDescriptionTMP.text = CurrentWeaponItemDataSO.weaponStatDescription;
        _weaponDescriptionTMP.text = CurrentWeaponItemDataSO.weaponDescription;
        _weapnIcon.sprite = CurrentWeaponItemDataSO.itemIcon;
    }
}
